# 使用cat函数输出中文文本
cat("你好，世界！", file = "test.txt", encoding = "UTF-8", append = TRUE, sep = "\n")